<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改律所机构信息')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-lawFirm-edit" th:object="${crUser}">
            <input name="userId" th:field="*{userId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">登录账号：</label>
                <div class="col-sm-8">
                    <input name="loginId" th:field="*{loginId}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">密码：</label>
                <div class="col-sm-8">
                    <input name="password" th:field="*{password}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="userName" th:field="*{userName}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">身份证号码：</label>
                <div class="col-sm-8">
                    <input name="idCard" th:field="*{idCard}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">地址：</label>
                <div class="col-sm-8">
                    <input name="address" th:field="*{address}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">手机号：</label>
                <div class="col-sm-8">
                    <input name="mobile" th:field="*{mobile}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">邮箱：</label>
                <div class="col-sm-8">
                    <input name="email" th:field="*{email}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">社会统一信用代码：</label>
                <div class="col-sm-8">
                    <input name="socialUnifiedCreditCode" th:field="*{socialUnifiedCreditCode}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">法定代表人：</label>
                <div class="col-sm-8">
                    <input name="legalRepresentative" th:field="*{legalRepresentative}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系电话：</label>
                <div class="col-sm-8">
                    <input name="fixedTelephone" th:field="*{fixedTelephone}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"><span></span>头像：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="headPortrait" id="headPortrait" th:field="*{headPortrait}">
                    <div class="layui-hide" id="imgPaths">
                        <hr>
                        <img src="" id="img0" alt="上传成功后渲染" style="max-width: 196px">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"><span></span>身份证照片正面：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="idCardFacade" id="idCardFacade" th:field="*{idCardFacade}">
                    <div class="layui-hide" id="imgPathsidCardFacade">
                        <hr>
                        <img src="" id="img1" alt="上传成功后渲染" style="max-width: 196px">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"><span></span>身份证照片反面：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="idCardBack" id="idCardBack" th:field="*{idCardBack}">
                    <div class="layui-hide" id="imgPathsidCardBack">
                        <hr>
                        <img src="" id="img2" alt="上传成功后渲染" style="max-width: 196px">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"><span></span>营业执照照片：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="businessLicenseImage" id="businessLicenseImage" th:field="*{businessLicenseImage}">
                    <div class="layui-hide" id="imgPathsbusinessLicenseImage">
                        <hr>
                        <img src="" id="img3" alt="上传成功后渲染" style="max-width: 196px">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">审核状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('approval_status')}">
                        <input type="radio" th:id="${'auditStatus_' + dict.dictCode}" name="auditStatus" th:value="${dict.dictValue}" th:field="*{auditStatus}">
                        <label th:for="${'auditStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <!-- 放大后的图片 -->
    <div id="outerdiv" style="position:fixed;top:0;background:rgba(0,0,0,0.7);z-index:2000;display:none;width: 100%;height: 100%;text-align: center">
        <div id="innerdiv" style="margin: 0 auto;">
            <img id="bigimg" style="border:5px solid #fff;width: auto;;height:auto;" src="" />
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "business/lawFirm";
        $("#form-lawFirm-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/audit", $('#form-lawFirm-edit').serialize());
            }
        }

        $("input[name='auditTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        function imgShow(outerdiv, innerdiv, bigimg, _this) {
            var src = _this.attr("src");//获取当前点击的pimg元素中的src属性
            $('#outerdiv').attr('display', 'block');
            $(bigimg).attr("src", src);//设置#bigimg元素的src属性
            $(outerdiv).fadeIn("fast");

            $(outerdiv).click(function () {//再次点击淡出消失弹出层
                $(this).fadeOut("fast");
            });
        }
        $(function() {
            $('#imgPaths').removeClass('layui-hide').find('img').attr('src', [[${crUser.headPortrait}]]);
            $('#imgPathsidCardFacade').removeClass('layui-hide').find('img').attr('src', [[${crUser.idCardFacade}]]);
            $('#imgPathsidCardBack').removeClass('layui-hide').find('img').attr('src', [[${crUser.idCardBack}]]);
            $('#imgPathsbusinessLicenseImage').removeClass('layui-hide').find('img').attr('src', [[${crUser.businessLicenseImage}]]);

            $("#img0").click(function(){
                var _this = $(this);//将当前的pimg元素作为_this传入函数
                imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
            });
            $("#img1").click(function(){
                var _this = $(this);//将当前的pimg元素作为_this传入函数
                imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
            });
            $("#img2").click(function(){
                var _this = $(this);//将当前的pimg元素作为_this传入函数
                imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
            });
            $("#img3").click(function(){
                var _this = $(this);//将当前的pimg元素作为_this传入函数
                imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
            });
        });
    </script>
</body>
</html>